package work.xiaohong.jijin.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import static io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_ONLY;

/**
 * 
 * @author xiaohong
 * @since 2021-11-07 13:37:13
 */
@Getter
@Setter
@TableName("jijin_store")
@Schema(name = "基金库存对象", description = "")
public class Store implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID",accessMode = READ_ONLY)
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "基金代码")
    @TableField("code")
    private String code;

    @Schema(description = "基金名称")
    @TableField("name")
    private String name;

    @Schema(description = "买进日期")
    @TableField("buyDay")
    private LocalDateTime buyDay;

    @Schema(description = "买进金额")
    @TableField("buyMoney")
    private Float buyMoney;

    @Schema(description = "买进净值")
    @TableField("buyPrice")
    private Float buyPrice;

    @Schema(description = "买进份额")
    @TableField("buyNumber")
    private Float buyNumber;

    @Schema(description = "距离可赎天数")
    @TableField("freeDay")
    private Integer freeDay;

    @Schema(description = "卖出净值")
    @TableField("sellPrice")
    private Float sellPrice;

    @Schema(description = "卖出价格")
    @TableField("sellMoney")
    private Float sellMoney;

    @Schema(description = "卖出时间")
    @TableField("sellDay")
    private LocalDateTime sellDay;

    @Schema(description = "交易完成时间")
    @TableField("dealDay")
    private LocalDateTime dealDay;

    @Schema(description = "买入状态0 买入中 1 已买入 3 卖出中 4 已卖出 5 已撤回")
    @TableField("status")
    private Integer status;

    @Schema(description = "创建时间",accessMode = READ_ONLY)
    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    @Schema(description = "更改时间",accessMode = READ_ONLY)
    @TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;

    @Schema(description = "乐观锁",accessMode = READ_ONLY)
    @TableField("version")
    @Version
    private Integer version;

    @Schema(description = "逻辑删除标志",accessMode = READ_ONLY)
    @TableField("deleted")
    @TableLogic
    private Integer deleted;

    @TableField(exist = false)
    private Integer isIdea; // 是否建议卖出(0不建议 1建议卖出)

    @TableField(exist = false)
    private Float profit; // 预计盈亏
}
